<script setup lang="ts">
import { onLaunch, onShow, onHide } from "@dcloudio/uni-app";
import { useStore } from 'vuex'
const store = useStore()
onLaunch(() => {
  console.log("App Launch");
  //初始化用户信息
	uni.getStorage({
		key:'uinfo',
		success:(res)=>{
			console.log('本地有用户信息',res.data);
			store.commit('user/init',res.data)
		}
	})
  //判断用户首次使用
  uni.getStorage({
	  key:'first',
	  fail:()=>{
		uni.redirectTo({
			url:'/pages/welcome/welcome'
		})
	  }
  })
});
onShow(() => {
  console.log("App Show");
});
onHide(() => {
  console.log("App Hide");
});
</script>
<style>
	@import 'colorui/icon.css';
	@import 'colorui/main.css';
	@import 'colorui/animation.css';
	@import 'static/font/iconfont.css';
</style>
